package com.bridgeintelligent.tag.webserver.security;

import java.util.List;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

public interface SsoService {

    @Getter
    @Setter
    @Accessors(chain = true)
    public static class SsoLoginData {
        private String username;
        private String token;
        private String refreshToken;
        private String expires;
    }

    @Getter
    @Setter
    @Accessors(chain = true)
    public static class SsoToeknData {
        private String access_token;
        private String expires_in;
        private String refresh_token;
    }

    @Getter
    @Setter
    @Accessors(chain = true)
    public static class SsoUserData {
        private List<String> spRoleList;
        private String orgNamePath;
    }

    @Getter
    @Setter
    @Accessors(chain = true)
    public static class SsoUserDataVo {
        private String username;
        private String deptname;
    }

    /**
     * 从第三方将用户信息同步到画像系统
     * @param authCode SSO参数
     * @param state SSO参数
     * @return 返回同步后的用户实例
     */
    SsoLoginData syncUesrData(String authCode, String state) throws Exception;

}
